package com.ruitaowang.core.utils;

import java.util.ArrayList;
import java.util.List;

public class Paging {
    public static List pageing(List s,int page,int rows){
        List list = new ArrayList();
        int ji = page * rows;
        int yeshu = (s.size() / rows) + 1;
        int bjz = s.size() % rows;
        for(int i = ji - rows;i < ji;i++){
            if(bjz == 0 && yeshu - page > 0){
                list.add(s.get(i));
            }else if(bjz != 0 &&  s.size() - i > 0){
                list.add(s.get(i));
            }
        }
        return list;
    }
}
